/*
 *  Book.cpp
 *  Book
 *
 *  Created by Hamza SHAWY and Jonathan SCHRODER on 10/10/07.
 *  Copyright 2007 __MyCompanyName__. All rights reserved.
 *
 */

 #include "Reference.h"
 #include "Book.h"

 #include <iostream>
 #include <iomanip>
 
 using std::cout;
 using std::endl;



/* Definition of the default constructor  "Book" of the class "Article" */ 
    Book::Book( ) : Reference ( -1 , -1, "<undefined yet>" , "<undefined yet>"), NumberOfPages (-1), Publisher(" <undefined yet> ")
	{} // end Book default constructor

/* Definition of the regular constructor  "Book"  */     
	Book::Book(int id, int year, int nPages, string author, string title,  string publish) : Reference ( id, year, author, title),
	NumberOfPages (nPages), Publisher (publish)
	{}// end Book regular constructor
															  
/*  Definition of the dedstructor  "~Book" of the class "Book"  */ 
    Book::~Book()   
	{} // end Article destructor	 

/*  Definition of the method "getNumberOfPages" of the class "Book"  */    
    int Book::getNumberOfPages() const
	  {
	   return NumberOfPages;// returns the start page
	  } // end function getStartPage

/*  Definition of the method "getPublisher" of the class "Book"  */    
    string Book::getPublisher() const
	  {
	   return Publisher;// returns the publisher
	  } // end function getPublisher  	  

/*  Definition of the method "print" of the class "Book"	*/																																																																								  
	void Book::print()  //prints a string representation of this Book consisting of the id number, reference title, author and year of publication; 
	  {
        Reference :: print(); //  This member function overrides the one defined in the class Reference.
		cout << "  * The Book is also specified by its : "<< endl;
		cout <<  "						5) Number of pages which is : "<< getNumberOfPages()<<endl;
		cout <<  "						6) Publisher, and those are : "<< getPublisher()<<endl;
	  } // end function print	 

	
/*  Definition of the member function "setPublisher" of the class "Book" */     
    void Book::setPublisher( string publish  )  // Sets the book's publisher                
    {                                                           
       Publisher = publish ;                     
	} // end function setPublisher

	
/*  Definition of the member function "setNumberOfPages" of the class "Book" */     
    void Book::setNumberOfPages( int numb  )  // Sets the book's publisher                
    {                                                           
       NumberOfPages = numb ;                     
	} // end function setNumberOfPages
	
			
	
	
	
	
	